/**
 * description: 开发环境
 * date: 2022/04/15/22:06:00
 * author: xinyu
 * version: 1.0
 **/

import babel from 'rollup-plugin-babel'
import resolve from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'
import commonjs from '@rollup/plugin-commonjs'
import { terser } from 'rollup-plugin-terser'
import serve from 'rollup-plugin-serve'
import livereload from 'rollup-plugin-livereload'
export default {
    input: './src/main.js',
    output: {
        file: './dist/bundle.js',
        format: 'cjs',
        name: 'bundleName',
        sourcemap: true
    },
    plugins: [
        commonjs(),
        resolve(),
        typescript(),
        babel({
            exclude: 'node_modules/**'
        }),
        terser(),
        serve({
            open: true,
            contentBase: 'dist'
        }),
        livereload(),
    ],
    external: ['lodash']
}